﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>选择商品属性</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../../CSS/bootstrap3.2/css/bootstrap.css" rel="stylesheet">
    <script src="../../Scripts/jquery-1.8.0.min.js"></script>
    <script src="../../Scripts/avalon.js"></script>
    <script src="../../Scripts/B2CCommon.js"></script>
    <script>
        var model = avalon.define({
            $id: "SPSXData",
            lb1: ComFunJS.getQueryString("lb1") ? ComFunJS.getQueryString("lb1") : "",
            lb2: ComFunJS.getQueryString("lb2") ? ComFunJS.getQueryString("lb2") : "",
            ListData: [],
            Savedata: function () {

            }
        })
        avalon.ready(function () {
            $.getJSON("../Comon/ComAjaxHandler.ashx", { Action: "GetJsonData", Table: "PT_Pro_Category_SX", QueryCondition: " AND LB1='" + model.lb1 + "' AND LB2='" + model.lb2+ "'" }, function (data) {
                if (data) {
                    model.ListData = data;
                }
                else {
                }
            });
        })


        function getselsx() {
            var seldata = [];
            $(".sx").each(function () {
                var sxname = $.trim($(this).find("td").eq(0).text());
                var sxvalue = "";
                $(this).find("input").each(function () {
                    if ($(this).attr("checked")) {
                        sxvalue = sxvalue + $(this).val() + ",";
                    }
                })
                var reg = /,$/gi;
                sxvalue = sxvalue.replace(reg, "");
                seldata.push({ "sxname": sxname, "sxvalue": sxvalue });
            })
            return seldata;
        }
    </script>


</head>
<body>
    <div class="container-fluid" ms-controller="SPSXData" style="margin-top: 20px">
        <table class="table table-bordered  table-hover table-hover">
            <tr ms-repeat-el="ListData" class="sx">
                <td>{{el.SXName}}</td>
                <td>
                    <label class="checkbox-inline" ms-repeat-item="$.parseJSON(el.SXValue)">
                        <input type="checkbox" ms-value="item.SXValue"> {{item.SXValue}}
                    </label>

                </td>
            </tr>
        </table>
    </div>
</body>
</html>
